using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Com
{
	public class FieldBusDriverType
	{
		public const int _SIMULATION = 0;
		public const int _MELSECNET = 1;
		public const int _CCLINK = 2;
		public const int _DEVICENET = 3;
		public const int _FILE = 4;
		private int _value;
		private static int _size;
		private static FieldBusDriverType[] _array;
		public static string[] displayStrings;
		public static FieldBusDriverType[] dispalyValues;
		public static FieldBusDriverType SIMULATION;
		public static FieldBusDriverType MELSECNET;
		public static FieldBusDriverType CCLINK;
		public static FieldBusDriverType DEVICENET;
		public static FieldBusDriverType FILE;
		public static FieldBusDriverType IT_ENUM_MAX;
		static FieldBusDriverType()
		{
			FieldBusDriverType._size = 5;
			FieldBusDriverType._array = new FieldBusDriverType[FieldBusDriverType._size];
			FieldBusDriverType.displayStrings = new string[FieldBusDriverType._size];
			FieldBusDriverType.dispalyValues = new FieldBusDriverType[FieldBusDriverType._size];
			FieldBusDriverType.SIMULATION = new FieldBusDriverType(0);
			FieldBusDriverType.MELSECNET = new FieldBusDriverType(1);
			FieldBusDriverType.CCLINK = new FieldBusDriverType(2);
			FieldBusDriverType.DEVICENET = new FieldBusDriverType(3);
			FieldBusDriverType.FILE = new FieldBusDriverType(4);
			FieldBusDriverType.IT_ENUM_MAX = new FieldBusDriverType(2147483647);
			FieldBusDriverType.displayStrings[0] = "SIMULATION";
			FieldBusDriverType.displayStrings[1] = "MELSECNET";
			FieldBusDriverType.displayStrings[2] = "CCLINK";
			FieldBusDriverType.displayStrings[3] = "DEVICENET";
			FieldBusDriverType.displayStrings[4] = "FILE";
			FieldBusDriverType.dispalyValues[0] = FieldBusDriverType.SIMULATION;
			FieldBusDriverType.dispalyValues[1] = FieldBusDriverType.MELSECNET;
			FieldBusDriverType.dispalyValues[2] = FieldBusDriverType.CCLINK;
			FieldBusDriverType.dispalyValues[3] = FieldBusDriverType.DEVICENET;
			FieldBusDriverType.dispalyValues[4] = FieldBusDriverType.FILE;
		}
		public static string ValueToString(FieldBusDriverType val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = FieldBusDriverType.displayStrings[0];
				break;
			case 1:
				result = FieldBusDriverType.displayStrings[1];
				break;
			case 2:
				result = FieldBusDriverType.displayStrings[2];
				break;
			case 3:
				result = FieldBusDriverType.displayStrings[3];
				break;
			case 4:
				result = FieldBusDriverType.displayStrings[4];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static FieldBusDriverType StringToValue(string val)
		{
			FieldBusDriverType result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = FieldBusDriverType.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < FieldBusDriverType.displayStrings.Length; i++)
				{
					if (val.Equals(FieldBusDriverType.displayStrings[i]))
					{
						result = FieldBusDriverType.dispalyValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static FieldBusDriverType From_Int(int value)
		{
			FieldBusDriverType result;
			if (value >= 0 && value < FieldBusDriverType._size)
			{
				result = FieldBusDriverType._array[value];
			}
			else
			{
				result = FieldBusDriverType.IT_ENUM_MAX;
			}
			return result;
		}
		protected FieldBusDriverType(int value)
		{
			this._value = value;
			if (value >= 0 && value < FieldBusDriverType._size)
			{
				FieldBusDriverType._array[this._value] = this;
			}
		}
		public bool Equals(FieldBusDriverType otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return FieldBusDriverType.displayStrings[this._value];
		}
	}
}
